//
// Created by 谢哲 on 2021/5/8.
//

#include <iostream>
#include <vector>
#include <string>
using namespace std;

vector<int> vdata;
void dfs(int pos, int s, int n, int r) {
    if (s == r) {
        for (auto p: vdata) {
            string kg;
            for (int i=3-to_string(p).length();i;--i) kg += " ";
            cout << kg << p;
        }
        cout << "\n";
        return;
    }
    if (pos > n) return;
    for (int i=pos; i<=n; ++i) {
        vdata[s] = i;
        dfs(i+1, s+1, n, r);
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, r;
    cin >> n >> r;
    vdata.resize(r, 0);
    dfs(1, 0, n, r);

    return 0;
}